package model.db;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 * Created by IntelliJ IDEA.
 * User: jc218934
 * Date: 01/09/2011
 * Time: 1:48:03 PM
 * To change this template use File | Settings | File Templates.
 */
public class Select
{
    public static int getInt(String strToExecute)
    {
        try
        {

            Connection con = OurConnection.connect();

            Statement stmt = con.createStatement();

            ResultSet resultset = stmt.executeQuery(strToExecute);

            while (resultset.next())
            {

                int val = resultset.getInt(1);
                con.close();

                return val;
            }
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }
        return -1;
    }
}
